/*
*	Definition of the auxiliary structures
*/

/////////////////////////////////////////
// DATE TIME STAMP STRUCTURE
// 4 byte (32 bit)

struct PackedDate{
	unsigned int Second : 6;	//(0..59)
	unsigned int Minute : 6;	//(0..59)
	unsigned int Hour : 5;		//(0..23)
	unsigned int Day : 5;		//(1..31)
	unsigned int Month : 4;		//(1..12)
	unsigned int Year : 6;		//(0..80) + 1960
};

typedef unsigned __int32 DATE_TIME_INT;

union unionDateTime
{
	DATE_TIME_INT iDate;
	struct PackedDate Date;
};

typedef union unionDateTime DateTime;


/////////////////////////////////////////
// Price indexs

enum PRICE : short {OPEN, HIGH, LOW, CLOSE};

#define EMPTY -9999

typedef unsigned char byte;
typedef unsigned long ulong;


#define Max(a, b) ( ( (a) > (b) ) ? (a) : (b) )
#define Min(a, b) ( ( (a) < (b) ) ? (a) : (b) )